package fr.afcepf.ai89.esharing.managedbean;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;

import fr.afcepf.ai89.esharing.entity.Emprunt;
import fr.afcepf.ai89.esharing.entity.Proprietaire;
import fr.afcepf.ai89.esharing.metier.BusinessEmpruntAem;
import fr.afcepf.ai89.esharing.metier.IBusinessEmpruntAem;

public class EmpruntsAnnulesManagedBean {
	
	IBusinessEmpruntAem busEmp = new BusinessEmpruntAem();
	List<Emprunt> empsAnnules = new ArrayList<Emprunt>();
	
	ConnexionManagedBean mbConnexion = new ConnexionManagedBean();
	
	public ConnexionManagedBean getMbConnexion() {
		return mbConnexion;
	}

	public void setMbConnexion(ConnexionManagedBean mbConnexion) {
		this.mbConnexion = mbConnexion;
	}

	public IBusinessEmpruntAem getBusEmp() {
		return busEmp;
	}
	
	public void setBusEmp(IBusinessEmpruntAem busEmp) {
		this.busEmp = busEmp;
	}
	
	public List<Emprunt> getEmpsAnnules() {
		
		empsAnnules = busEmp.getEmpruntsAnnules(mbConnexion.getPropConnecte().getProp());
		
		for (Emprunt em : getEmpsAnnules()) {
			
			//System.out.println("***LOOKIEMEE***");
			//System.out.println(em.getIdEmprunt() + " " + em.getDateDebut() + " " + em.getDateFin());
			
		}
		
		return empsAnnules;
		
	}
	
	public void setEmpsAnnules(List<Emprunt> empsAnnules) {
		this.empsAnnules = empsAnnules;
	}
	
	public EmpruntsAnnulesManagedBean() {
		
		
		
	}
	
}
